package com.xuecheng.content.model.mapper;

import com.xuecheng.content.model.dto.AddCourseDto;
import com.xuecheng.content.model.dto.CourseBaseInfoDto;
import com.xuecheng.content.model.dto.CourseCategoryDto;
import com.xuecheng.content.model.po.CourseBase;
import com.xuecheng.content.model.po.CourseCategory;
import com.xuecheng.content.model.po.CourseMarket;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @author luhao
 * @ClassName CourseMapper.java
 * @Description 课程实体类映射接口
 * @createTime 2023/5/16
 */
@Mapper(componentModel = "spring")
public interface CourseMapperStruct {
    CourseCategoryDto toCourseCategoryDto(CourseCategory courseCategory);

    List<CourseCategoryDto> toCourseCategoryDtoList(List<CourseCategory> courseCategory);

    CourseBase toCourseBase(AddCourseDto addCourseDto);

    CourseMarket toCourseMarket(AddCourseDto addCourseDto);
    @Mappings(@Mapping(source = "courseBase.id",target = "id"))
    CourseBaseInfoDto toCourseBaseInfoDto(CourseBase courseBase, CourseMarket courseMarket);
}
